<?php

class TemplateJavascript extends TemplateParser
{

  protected function render()
  {
    global $config;

    $output = '';

    extract($this->params);

    $url = $name;
    if (! sy_url_is_absolute($url)) {
      $url = $config['theme_url'] . '/javascript/' . $name . '.js';
    }

    $output = "<script type=\"text/javascript\" src=\"$url\"></script>";

    return $this->parseVars($output);
  }

}
